Closed Bug 1962439 Opened 1 month ago Closed 1 month ago

contenteditable=plaintext-only inserts <br>

Categories

(Core :: DOM: Editor, defect)

Firefox 137
defect

Tracking

()

RESOLVED INVALID

People

(Reporter: steiner.thomas, Unassigned)

References

()

Details

Attachments

(1 file)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/135.0.0.0 Safari/537.36

Steps to reproduce:

  1. Go to https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Global_attributes/contenteditable
  2. Enter text with line breaks
  3. Note how the element contains <br>

Actual results:

There should not be <br>

Expected results:

There should be a regular \n

Component: Untriaged → DOM: Editor
Product: Firefox → Core

The white-space value is normal. Therefore, \n should be treated as a collapsible white-space. So, <br> is required for a line break. I think that you expect the hack of Chromium which overrides white-space style forcibly. That's illegal behavior.

Status: UNCONFIRMED → RESOLVED
Closed: 1 month ago
Resolution: --- → INVALID

So, if you want both Firefox and Safari work as Chrome, specifying white-space: pre-wrap.

Oh, thanks for the pointer to https://crbug.com/413427424. I have changed the component of this bug to be (hopefully) more adequate.

You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: